package com.zhuangjie.order.controller;

import com.zhaungjie.base.conduit.R;
import com.zhuangjie.order.service.OrderAmountService;
import com.zhuangjie.order.vo.ShopProfitForShopOrderAccountingVO;
import com.zhuangjie.security.annotations.OnlySystemCall;
import com.zhuangjie.security.annotations.PublicAPI;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 订单金额详细表 前端控制器
 * </p>
 *
 * @author zhuangjie
 * @since 2024-03-30
 */
@RestController
@RequestMapping("/order-amount")
public class OrderAmountController {
    @Autowired
    private OrderAmountService orderAmountService;

    @GetMapping("/query-shop-order-profit-for-accounting/{orderId}")
    @ApiOperation("获取订单商家利润-为了商家入账（会判断订单是否完成）")
    @PublicAPI
    @OnlySystemCall
    public R queryShopOrderProfitForAccounting(@PathVariable("orderId") Long orderId) {
        return R.require(ShopProfitForShopOrderAccountingVO.class,orderAmountService.queryShopOrderProfitForAccounting(orderId));
    }


}
